package org.example.workbench.service.impl;

import org.example.workbench.domain.Contacts;
import org.example.workbench.mapper.ContactsMapper;
import org.example.workbench.service.ContactsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("ContactsService")
public class ContactsImpl implements ContactsService {
    @Autowired
    private ContactsMapper contactsMapper;

    @Override
    public Contacts getOneContactsDetailById(String id) {
        return contactsMapper.getOneContactsDetailById(id);
    }

    @Override
    public int updateOneContactsByContact(Contacts contacts) {
        return contactsMapper.updateOneContactsByContact(contacts);
    }

    @Override
    public Contacts getOneContactsById(String id) {
        return contactsMapper.getOneContactsById(id);
    }

    @Override
    public int insertOneContactsByContacts(Contacts contacts) {
        return contactsMapper.insertOneContactsByContacts(contacts);
    }

    @Override
    public int getTotalContactsCount(Map<String, Object> map) {
        return contactsMapper.getTotalContactsCount(map);
    }

    @Override
    public List<Contacts> getContactsByMap(Map<String,Object> map) {
        return contactsMapper.getContactsByMap(map);
    }

    @Override
    public int deleteOneContactsById(String contactsId) {
        return contactsMapper.deleteOneContactsById(contactsId);
    }

    @Override
    public int insertContactByContact(Contacts contacts) {
        return contactsMapper.insertContactByContact(contacts);
    }

    @Override
    public List<Contacts> getContactsByName(String contactsName) {
        return contactsMapper.getContactsByName(contactsName);
    }

    @Override
    public List<Contacts> getContactsDetailByCustomerId(String customerId) {
        return contactsMapper.getContactsDetailByCustomerId(customerId);
    }
}
